package com.meowcook.dao;

import com.meowcook.pojo.po.Recipe;

import java.util.List;

public interface RecipeMapper {
    int insert(Recipe row);

    int insertSelective(Recipe row);

    Recipe selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Recipe row);

    int updateByPrimaryKey(Recipe row);

    /**
     * 根据板块id查询食谱列表
     * @param boardId 板块id
     * @return List<Recipe>
     */
    List<Recipe> selectByBoardId(Long boardId, Integer offset, Integer limit);

    /**
     * 根据食谱id查询食谱详情
     * @param recipeId 食谱id
     * @return Recipe
     */
    Recipe selectDetailByRecipeId(Long recipeId);

    /**
     * 根据用户Id查询用户发布的食谱列表
     * @param userId 用户Id
     * @return List<recipe>
     */
    List<Recipe> selectByUserId(Long userId, Integer offset, Integer limit);


    /**
     * 根据用户id查询用户收藏的食谱列表
     * @param userId 用户id
     * @param blocked 列表是否包含非公开食谱
     * @return List<Recipe>
     */
    List<Recipe> selectCollectionByUserId(Long userId, Integer offset, Integer limit, Integer blocked);
}